package com.alex.gulimarket.service.impl;

import com.alex.gulimarket.dao.TestDao;
import com.alex.gulimarket.dao.UserMapper;
import com.alex.gulimarket.entity.TbUser;
import com.alex.gulimarket.service.TestService;

import com.alibaba.fastjson2.JSON;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;



@Service
public class TestServiceImpl implements TestService {

    @Resource
    TestDao testDao;

    @Resource
    UserMapper userMapper;

    @Override
    public String testService(Integer integer) {

        if (integer == 1) {
            return "hello world";
        } else {
            return "no word";
        }
    }

    @Override
    public String getUser(Integer integer) {

        TbUser tbUser = userMapper.selectById(integer);
        return JSON.toJSONString(tbUser);
    }
}
